package com.travel.feign;

import com.travel.page.NewPage;
import com.travel.pojo.Hotel;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.data.domain.Page;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient("es-service")
public interface EsFeign {

    @ApiImplicitParams({
            @ApiImplicitParam(name = "keyword", value = "城市名称或者酒店名称", required = true, paramType = "query"),
            @ApiImplicitParam(name = "pageNumber", value = "页数",required = false, paramType = "query"),
            @ApiImplicitParam(name = "pageSize", value = "每页数据条数",required = false, paramType = "query"),
    })
    @GetMapping("/search")
    NewPage search(@RequestParam(value = "keyword") String keyword,
                   @RequestParam(value = "pageNumber",defaultValue = "0") int pageNumber,
                   @RequestParam(value = "pageSize",defaultValue = "10") int pageSize);

    @GetMapping("/hotelSearch/estest")
    String estest();
}
